package cn.dyw.cloudmusic.http;

import cn.dyw.cloudmusic.http.model.Params;
import okhttp3.Request;

/**
 * @author: dyw770
 * @Date: 2018/12/11 20:57
 * @Description: 构建请求头
 */
public class HttpHeaderBuild {

    public static void buildHttpHeader(Request.Builder builder, Params p) {
        builder.addHeader("Host", "music.163.com")
                .addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0")
                .addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
                .addHeader("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2")
                .addHeader("Content-Type", "application/x-www-form-urlencoded")
                .addHeader("Content-Length", "478")
                .addHeader("Connection", "keep-alive")
                .addHeader("Cookie", "_iuqxldmzr_=32; _ntes_nnid=85d7c6195ba4168a29db5101560ec014,1542939951738; _ntes_nuid=85d7c6195ba4168a29db5101560ec014; WM_TID=Kqq1MftQQJJAQBFQUFNpb3RRA9mPhzLD; UM_distinctid=1675fda2c8d1082-07a3d828341d9a-4313362-1fa400-1675fda2c8eed; __gads=ID=3ea7381815793c5f:T=1543501395:S=ALNI_MZ5gy0ssLzTvQTeOYZgDvHXDsgjKQ; vinfo_n_f_l_n3=5513f0f219e31f28.1.0.1543501393573.0.1543501598711; __remember_me=true; P_INFO=929659095@qq.com|1544785048|0|game|00&99|sic&1544784734&nsh#sic&510100#10#0#0|&0|nsh_web&nsh_ngp&nsh&game|929659095@qq.com; __utmz=94650624.1545305076.18.13.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; _nietop_foot=%u9006%u6C34%u5BD2%7Cn.163.com%2C; JSESSIONID-WYYY=RwtSBwAXqcpadjlY0ukHoCqh4c0pytVM01qdOzr%2F%2Btri6A683H0Sr1AacSptCeGCUn8p%2FWWXZSmKVF%5Cna%2BNaQ%2B4Yp5vdj%2BK0f%2B6UwqY2fw4sxUtr73jZC8gIgulXV7oZlbsyYK%2F57eTdhuIdDPDQ5lcSw3UshdQClREk%5Cy7z0ismQzbH%3A1545657423909; __utma=94650624.1288545821.1542939952.1545305076.1545655624.19; __utmc=94650624; WM_NI=t9BDH2TEIO4tDzbMoPWaxZ46tNJlTiyYa4gzALUTZAK8ThkRLgIfMpi%2BJS33vbAV%2FbLwazxlGAk%2FXZxYbb0VRvczlCzHCYKYCj59gLWyfCa704HL%2FC%2FVMXHW2vnRKPjrZmg%3D; WM_NIKE=9ca17ae2e6ffcda170e2e6eea2b85fb387fa8bf7728fac8ea3d44a968e9ebaf348f6b48eaad1478aeefbd4d02af0fea7c3b92ab8e78ea5cb3a989b87b0b78088a6aeaeee5c95bfb8bbb73eb892868dd763bb87afd5e67283949bb5d94b89e89c89ea5a90b98787d07cabf586b4b239b6be8fb7ae6a90a9af9bfb68859fa5d0db52bc87ae83b35e92aaad9bef49ba988dbaca5381b6fbdae64895a7aaa4e43df4ec88adae49ed8a83b9cb5df2aaa2b3ca5caaae968ee637e2a3; playerid=17347865; __utmb=94650624.6.10.1545655624; MUSIC_U=b02435d5c90e6cb541642af3771d09e8df048352731c62e3a484406cb425842fba2f8c78a672cf9d8bb1a6f2c74ed5f1671b221228c833868a65b2763349abcb8de6b39b827f0b9fbf122d59fa1ed6a2; __csrf=6b6deb787beea0c250d3cb62a2d794e4")
                .addHeader("Referer", "https://music.163.com/song?id=" + p.songId())
                .addHeader("Cache-Control", "no-cache");
    }
}
